from pyfbsdk import *

app=FBApplication()
system=FBSystem()
scene=system.Scene

RV_SKELETON_NAME=[
"Hips",
"Chest",
"LeftCollar",
"LeftUpArm",
"LeftLowArm",
"LeftHand",
"Neck",
"Head",
"RightCollar",
"RightUpArm",
"RightLowArm",
"RightHand",
"LeftUpLeg",
"LeftLowLeg",
"LeftFoot",
"RightUpLeg",
"RightLowLeg",
"RightFoot"
]

MOBU_SKELETON_NAME=[
"Hips",
"Spine",
"LeftShoulder",
"LeftArm",
"LeftForeArm",
"LeftHand",
"Neck",
"Head",
"RightShoulder",
"RightArm",
"RightForeArm",
"RightHand",
"LeftUpLeg",
"LeftLeg",
"LeftFoot",
"RightUpLeg",
"RightLeg",
"RightFoot"
]

def rename():
    for index,name in enumerate(RV_SKELETON_NAME):
        model=FBFindModelByLabelName('BVH:'+name)
        if model:
            model.Name=MOBU_SKELETON_NAME[index]
            
rename()

